home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / hal / hal-unmount.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2007-03-30  |  398 b   |  17 lines

  1. #!/bin/sh
  2.  
  3. # sanity check. DEVNAME should start with a /
  4. [ "$DEVNAME" != "${DEVNAME#/}" ] || exit 0
  5.  
  6. # Lazily unmount drives which are removed, but still mounted
  7. if [ "$ACTION" = remove ] \
  8.    && (grep -q "^$DEVNAME" /proc/mounts || grep -q "^$DEVNAME" /etc/mtab); then
  9.   if [ -x /usr/bin/pumount ] ; then 
  10.     /usr/bin/pumount -l "$DEVNAME";
  11.   else 
  12.     /bin/umount -l "$DEVNAME";
  13.   fi
  14. fi
  15.  
  16. exit 0
  17.